
import baseRequest from "@/utils/request";

/**
 * 重写request
 * @param config
 * @returns {Promise | Promise<unknown>}
 */
const request = function (config) {
  config.baseURL = process.env.VUE_APP_BASE_API + '/middle'
  return baseRequest(config)
}

/**
 * 获取中控的价格
 * @returns {Promise|Promise<*>}
 */
export function getMiddlePrice(){
  return request({
    url: '/getMiddlePrice',
  })
}

/**
 * 获取代发数据
 * @param params
 * @returns {Promise|Promise<*>}
 */
export function getStickerOrderList(params = {}){
  return request({
    url: '/getStickerOrderList',
    params,
  })
}


/**
 * 获取头程数据
 * @param params
 * @returns {Promise|Promise<*>}
 */
export function getFLShipmentList(params = {}){
  return request({
    url: '/getFLShipmentList',
    params,
  })
}

/**
 * 获取送仓数据
 * @param params
 * @returns {Promise|Promise<*>}
 */
export function getMiddleOrderList(params = {}){
  return request({
    url: '/getMiddleOrderList',
    params,
  })
}

/**
 * 获取贴标数据
 * @param params
 * @returns {Promise|Promise<*>}
 */
export function getLabelOrderList(params = {}){
  return request({
    url: '/getLabelOrderList',
    params,
  })
}

export function getSettlementList(params = {}){
  return request({
    url: '/getSettlementList',
    params
  })
}

/**
 * 获取单个结算单
 * @param id
 * @returns {Promise|Promise<*>}
 */
export function getSettlementInfo(id){
  return request({
    url: `/getSettlementInfo/${id}`
  })
}

/**
 * 导出结算单
 * @param params
 * @returns {Promise|Promise<*>}
 */
export function exportSettleById(params){
  return request({
    url: '/exportSettleById',
    params
  })
}

export function exportDataByTimes(params){
  return request({
    url: '/exportDataByTimes',
    params,
  })
}
